package com.pengheng.bean;

import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.rely.FieldType;

import java.util.Set;

@Data
public class User {
    private String name;

    @IndexField(fieldType = FieldType.INTEGER)
    private Integer age;
    private String sex;
    private String password;
    /**
     * 多级嵌套
     */
    @IndexField(fieldType = FieldType.NESTED, nestedClass = Faq.class)
    private Set<Faq> faqs;

    public User() {
    }

    public User(String name, Integer age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public User(String name, Integer age, String password, Set<Faq> faqs) {
        this.name = name;
        this.age = age;
        this.password = password;
        this.faqs = faqs;
    }
}